﻿<%@ Page  Language="C#" AutoEventWireup="true" Inherits="Nivdal.Default" 
    Culture="auto:en-US" UICulture="auto" Codebehind="Default.aspx.cs" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" runat="server" dir="<%$ Resources:Resource, _TextDirection %>">
<head id="Head1" runat="server">
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta name="keywords" content="Online Football Manager Game"/>
    <meta name="description" content="Nivdal.com is a free online football manager game, where you manage your own football team.  Nivdal is fast growing community, where you can find many interesting people. All this is free! You are welcome to try!"/>
    <link rel="shortcut icon" href="~/Images/favicon.ico" />
    <link rel="icon" type="image/gif" href="~/Images/favicon.ico" />
    <asp:Literal ID="NoamStylesGlobalLiteral" runat="server"></asp:Literal>
    <asp:Literal ID="NoamStylesDefaultLiteral" runat="server" ></asp:Literal>
    <asp:Literal ID="StylesheetNewLiteral" runat="server"></asp:Literal>
    
    <asp:Literal ID="DirStylesheetLiteral" runat="server"></asp:Literal>

    <script src="JS/jquery-1.5.js" type="text/javascript"></script>
    
    <script language="javascript" type="text/javascript">

        function foo() {
            equalheights();
            Sys.WebForms.PageRequestManager.getInstance().add_endRequest(doequalheights);
            rsw_autoFocusAfterAJAX = false;
        }

        function doequalheights(sender, args) {
            equalheights();
        }

        function equalheights() {
            
            var loginheight = $("#login_area").height();
            var welcomeheight = $("#welcome_text_area").height();

            if (loginheight > welcomeheight) {
                $("#welcome_text_area").height(loginheight);
            }
            else {
                $("#login_area").height(welcomeheight);
            }

            $("#userscountcontainer").height();


            var fbheight = 360;
            var statsheight = $("#stats_div").height();

            if ($("#facebook_div").height() < fbheight) {
                $("#facebook_div").height(fbheight);
            }
            

            if (fbheight > statsheight) {
                $("#stats_div").height(fbheight);
            }
            else {
                $("#facebook_div").height(statsheight);
            }
        }
            
    </script>

</head>
<body onload="foo()" >
    <form id="form1" runat="server" action="Default.aspx" style="margin:0 0 0 0;">
    <cc1:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server" ScriptMode="Release"  >
    </cc1:ToolkitScriptManager>
    <script type="text/javascript">
        // facebook reloader during update panel refresh:
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandlerBerliner);
        function EndRequestHandlerBerliner(sender, args) {
            if (args.get_error() == undefined) {
                FB.XFBML.parse();
            }
        }
    </script>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    
    <div class="bg_layer1">
        
        <script type="text/javascript"  language="javascript">
            // no change of scroll position during update panel update
            var prm = Sys.WebForms.PageRequestManager.getInstance();

            prm.add_beginRequest(beginRequest);

            function beginRequest() {
                prm._scrollPosition = null;
            }
        </script>
    <div  class="bg_layer2_pic">
    <div class="auto_margin site_width" style="border: 1px solid transparent;">
    
    <%--<asp:Panel ID="DirectionPanel" runat="server" >--%>
        <asp:HiddenField ID="CookiesWarningStringHiddenField" runat="server" Value="<%$ Resources:Resource, Default_CookiesEnableWarning %>" />
        
        <div id="default_outsidediv" class="floater">
        <div class="tbl">
        <div class="tblr">
        <div class="tblc login_width">
            <asp:Panel ID="CodePanel" runat="server" DefaultButton="CodeButton" Visible="false" >
            <div class="basic_element login_width" id="login_area">
            <div class="tbl"><div class="tblr"><div class="red_title_default align">
                <asp:Label ID="CodeTitleLabel" runat="server" Text="Code:" CssClass="white_title_default"></asp:Label>
            </div></div></div>
            <div class="basic_padding">
                <asp:TextBox ID="CodeTextBox" runat="server" ></asp:TextBox>
                <asp:Button ID="CodeButton" runat="server" Text="Submit" OnClick="SubmitCode" />
            </div>
            </div>
            </asp:Panel>
            <asp:Panel ID="PostCodePanel" runat="server">
           <%-- <div class="LoginDivStyle" id="loginarea">--%>
                <asp:LoginView ID="LoginView1" runat="server">
                    <AnonymousTemplate>
                        <asp:Panel ID="LoginPanel" runat="server">
                            <asp:Login ID="Login1" runat="server" DestinationPageUrl="~/RegistrationMessage.aspx"
                                FailureText="<%$ Resources:Resource, Default_Login1Text %>">
                                <LayoutTemplate>
                                    <div class="basic_element login_width" id="login_area">
                                    <div class="tbl"><div class="tblr"><div class="red_title_default align">
                                       <asp:Label ID="MembersLoginLabel" runat="server" Text="<%$ Resources:Resource, Default_MembersLoginText %>" CssClass="white_title_default"></asp:Label>
                                    </div></div></div>
                                    <div class="basic_padding align">
                                        <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName" CssClass="login_titles"
                                         Text="<%$ Resources:Resource, Global_Username %>"></asp:Label>
                                        <br />
                                        <asp:TextBox ID="UserName" runat="server" Font-Size="18px" Height="20px" Width="250px" CssClass="rounded_corners"></asp:TextBox>
                                        <script language="javascript" type="text/javascript">
                                            document.getElementById("LoginView1_Login1_UserName").focus();                                                            
                                        </script>
                                        <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                                              ErrorMessage="*"  ValidationGroup="ctl00$Login1"></asp:RequiredFieldValidator>
                                        <br /><br />
                                        <asp:Label ID="PasswordLabel" runat="server" CssClass="login_titles"
                                            AssociatedControlID="Password" Text="<%$ Resources:Resource, Default_PasswordText %>"></asp:Label>
                                        <br />
                                        <asp:TextBox ID="Password" runat="server" Font-Size="18px" Height="20px" TextMode="Password"  Width="250px" CssClass="rounded_corners"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                            ErrorMessage="*" ValidationGroup="ctl00$Login1"></asp:RequiredFieldValidator>
                                        <br />
                                        <asp:Literal ID="FailureText" runat="server" Text=""></asp:Literal>
                                        <br />
                                        <asp:HyperLink ID="ForgotPasswordHyperLink" runat="server" CssClass="default_text_font red_inline_text" NavigateUrl="~/RecoverPassword.aspx" 
                                          Text="<%$ Resources:Resource, Default_ForgotPasswordHyperLinkText %>"></asp:HyperLink>
                                        &nbsp;&nbsp;
                                        <asp:HyperLink ID="RegisterHyperLink" runat="server" CssClass="default_text_font red_inline_text"  NavigateUrl="~/Register.aspx" 
                                        Text="<%$ Resources:Resource, Default_RegisterHyperLinkText %>"></asp:HyperLink>                                                
                                        &nbsp;&nbsp;
                                        <asp:Button ID="LoginButton" runat="server" ValidationGroup="ctl00$Login1" CssClass="bigredbutton antifloater" 
                                        Text="<%$ Resources:Resource, Default_SignInText %>" CommandName="Login" />
                                        <div class="clearBoth"></div>       
                                        
                                    </div>
                                    </div>
                                </LayoutTemplate>
                            </asp:Login>
                        </asp:Panel>
                    </AnonymousTemplate>
                </asp:LoginView>
            <%--</div>--%>
            </asp:Panel>
            <asp:Panel ID="FacebookPanel" runat="server">
            <div class="basic_element floater login_width" id="facebook_div">
            <div class="tbl"><div class="tblr"><div class="red_title_default align">
               <asp:Label ID="FacebookTitleLabel" runat="server" Text="<%$ Resources:Resource, Default_FacebookTitle %>" CssClass="white_title_default"></asp:Label>
            </div></div></div>
            <div class="basic_padding align">
                <script  type ="text/javascript" src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
                <fb:like-box href="http://he-il.facebook.com/pages/nivdal/134220936599342" width="300" show_border="false"
                    height="300" show_faces="true" stream="false" header="false" onerror="this.src='Images/facebookbg.jpg';"></fb:like-box>                    
            </div>               
            </div>
            </asp:Panel>
        </div>
        <div class="tblc default_width">
            <div class="default_padding">
            <asp:Panel ID="DefaultPanel" runat="server">
                <div class="basic_element" id="welcome_text_area">
                <div class="tbl"><div class="tblr"><div class="red_title_default align">
                   <asp:Label ID="AboutNivdalTitleLabel" runat="server" Text="<%$ Resources:Resource, Default_AboutNivdal %>" CssClass="white_title_default"></asp:Label>
                </div></div></div>
                    <div class="basic_padding align">
                    <img src="Images/logobeta3.png" alt="logo"  class="antifloater logo_inside" width="183" height="110"/>
                    <asp:Label ID="WelcomeInfoLabel" runat="server" CssClass="welcome_text" ></asp:Label>
                    <div class="clearBoth"></div>
                    <%--<div class="signup_button_div">--%>
                        <asp:Button ID="SignupButton" runat="server" Text="<%$ Resources:Resource, Default_PlayFreeText %>" PostBackUrl="~/Register.aspx" CssClass="bigredbutton antifloater"/>
                    <%--</div>--%>
                    <div class="clearBoth"></div>
                    </div>

               </div>
               <div class="basic_element" id="stats_div">
               <div class="tbl"><div class="tblr"><div class="red_title_default  align">
                    <asp:Label ID="CountrieTitleLabel" runat="server" Text="<%$ Resources:Resource, Default_SomeStatisticsTitle %>" CssClass="white_title_default"></asp:Label>
               </div></div></div>     
                    
               <div class="floater basic_padding  align">
                    <img src="Images/Globe.png" alt="countries" class="floater" />
                    <div class="floater">
                        
                    <asp:FormView ID="WorldStatsFormView" runat="server" DataSourceID="worldStatisticsSqlDataSource" Width="100%">
                    <ItemTemplate>
                        <div class="tbl" id="stats">
                        <div class="tblr">
                        <div class="tblc padding5">
                            <asp:Label ID="NumberOfCounrtiesTitleLabel" runat="server" Text="<%$ Resources:Resource, Countries_NumberOfCounrtiesTitleLabel %>" CssClass="default_text_font"></asp:Label>
                        </div>
                        <div class="tblc padding5">
                            <asp:Label ID="NumberOfActiveUsersLabel" runat="server" Text='<%# Eval("NumberOfCounrties") %>' CssClass="default_text_font blue_inline_text" ></asp:Label>
                        </div>
                        </div>
                        <div class="tblr">
                        <div class="tblc padding5">
                            <asp:Label ID="NumberOfUsersTitleLabel" runat="server" Text="<%$ Resources:Resource, Countries_NumberOfUsersTitleLabel %>" CssClass="default_text_font"></asp:Label>
                        </div>
                        <div class="tblc padding5">
                            <asp:Label ID="NumberOfUsersLabel" runat="server" Text='<%# Eval("NumberOfUsers") %>' CssClass="default_text_font blue_inline_text"></asp:Label>
                        </div>
                        </div>
                        <div class="tblr">
                        <div class="tblc padding5">
                            <asp:Label ID="CurrentSeasonTitleLabel" runat="server" Text="<%$ Resources:Resource, Countries_CurrentSeasonTitleLabel %>" CssClass="default_text_font"></asp:Label>
                        </div>
                        <div class="tblc padding5">
                            <asp:Label ID="CurrentSeasonLabel" runat="server" Text='<%# Eval("CurrentSeason") %>' CssClass="default_text_font blue_inline_text"></asp:Label>
                        </div>
                        </div>
                        <div class="tblr">
                        <div class="tblc padding5">   
                            <asp:Label ID="ActiveForumThreadsTitleLabel" runat="server" Text="<%$ Resources:Resource, Countries_ActiveForumThreadsTitleLabel %>" CssClass="default_text_font"></asp:Label>
                        </div>
                        <div class="tblc padding5">
                            <asp:Label ID="ActiveForumThreadsLevelLabel" runat="server" Text='<%# Eval("ActiveForumThreads") %>' CssClass="default_text_font blue_inline_text"></asp:Label>
                        </div>
                        </div>
                        <div class="tblr">
                        <div class="tblc padding5">
                            <asp:Label ID="TransfersLastDayTitleLabel" runat="server" Text="<%$ Resources:Resource, Countries_TransfersLastDayTitleLabel %>" CssClass="default_text_font"></asp:Label>
                        </div>
                        <div class="tblc padding5">
                            <asp:Label ID="TransfersLastDayLabel" runat="server" Text='<%# Eval("TransfersLastDay") %>' CssClass="default_text_font blue_inline_text"></asp:Label>
                        </div>
                        </div>
                        <div class="tblr">
                        <div class="tblc padding5">
                            <asp:Label ID="NumMatchesTitleLabel" runat="server" Text="<%$ Resources:Resource, Default_NumberOfMatchesLast24Hours %>" CssClass="default_text_font"></asp:Label>
                        </div>
                        <div class="tblc padding5">
                            <asp:Label ID="NumMatchesLabel" runat="server" Text='<%# Eval("NumMatches") %>' CssClass="default_text_font blue_inline_text"></asp:Label>
                        </div>
                        </div>
                        </div>
                    </ItemTemplate>
                    </asp:FormView>
                    </div>
                    <div class="clearBoth"></div>
                        <asp:SqlDataSource ID="worldStatisticsSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                        SelectCommand="Nivdal_GetWorldStatistics" SelectCommandType="StoredProcedure">
                    </asp:SqlDataSource>
                    <%--<asp:Repeater ID="CountriesRepeater" runat="server" DataSourceID="WorldCountryStatisticsSqlDataSource">
                    <ItemTemplate>
                        <asp:Hyperlink ID="FlagImage" runat="server" ImageUrl='<%# "~/Images/Flags/" + Eval("NationalFlag") %>'
                            NavigateUrl='<%# Eval("CountryId", "Country.aspx?Id={0}") %>' CssClass="rounded_corners floater flagpadding"
                            ToolTip='<%# Eval("CountryName") + " - " + Eval("NumberOfActiveUsers") + " " + Resources.Resource.Countries_NumberOfActiveUsersTitleLabel %>'  />
                    </ItemTemplate>
                    </asp:Repeater>--%>
                       
                </div>
                    
                    
                <div class="clearBoth"></div>
                <asp:Panel ID="TeamOfTheDayPanel" runat="server" Visible="false">
                    <div class="basic_element_in teamoftheday">
                    <div class="tbl"><div class="tblr"><div class="red_title">
                        <asp:Label ID="Label1" runat="server" Text="<%$ Resources:Resource, Default_TeamOfTheDayTitle %>"  CssClass="white_title_default"></asp:Label>
                    </div></div></div>
                    <div class="basic_padding  align">
                        <asp:Formview ID="TeamOfTheDayFormview" runat="server" DataSourceID="TeamOfTheDayDataSource">
                        <ItemTemplate>
                            <table cellspacing="4">
                            <tr>
                            <td colspan="2">
                                <asp:Hyperlink ID="TeamNameLabel" runat="server" Text='<%# Eval("TeamName") %>' CssClass="teamofthedaytitle"
                                    NavigateUrl='<%# "~/TeamHomePage.aspx?TeamId=" + Eval("TeamId") %>' ></asp:Hyperlink>
                            </td>
                            <td>
                                <asp:Label ID="ManagerTitile" runat="server" CssClass="teamofthedaytitle" Text="<%$ Resources:Resource, Global_Manager %>"></asp:Label>
                            </td>
                            </tr>
                            <tr>
                            <td style="vertical-align:top; ">
                                <asp:Image ID="LogoImage" runat="server" Height="100" ImageUrl='<%# Eval("TeamLogo") %>' AlternateText='<%# Eval("TeamName") %>'  onerror="this.src='Images/menupicture.gif';" />
                            </td>
                            <td style="vertical-align:top;">
                                <asp:Label ID="CountryTitleLabel" runat="server" Text="<%$ Resources:Resource, Global_Country %>" CssClass="reg_text"></asp:Label>
                                <asp:HyperLink ID="CountryText" runat="server" Text='<%# Eval("CountryName") %>' NavigateUrl='<%# "~/Country.aspx?Id=" + Eval("CountryId") %>' CssClass="reg_text red_inline_text"></asp:HyperLink>
                                <asp:HyperLink ID="CountryFlag" runat="server" ToolTip='<%# Eval("CountryName") %>' NavigateUrl='<%# "~/Country.aspx?Id=" + Eval("CountryId") %>'
                                    CssClass="rounded_corners" ImageUrl='<%# "~/Images/Flags/" + Eval("Flag")  %>'></asp:HyperLink>
                                <br />
                                <asp:Label ID="SinceTitleLabel" runat="server" CssClass="reg_text" Text="<%$ Resources:Resource, SinceTitleLabelText %>"></asp:Label>
                                <asp:Label ID="SinceLabel" runat="server" CssClass="reg_text red_inline_text" Text='<%# Eval("Since") %>'></asp:Label>
                                <br />
                                <asp:Label ID="LeagueTitleLabel" runat="server" Text="<%$ Resources:Resource, Global_Country %>" CssClass="reg_text"></asp:Label>
                                <asp:HyperLink ID="LeagueLink" runat="server" Text='<%# Eval("LeagueName") %>' CssClass="reg_text red_inline_text" NavigateUrl='<%# "~/league.aspx?LeagueId=" + Eval("LeagueId") %>'></asp:HyperLink>
                            
                            </td>
                            <td style="vertical-align:top; text-align:center;">
                                <asp:Image ID="UserPicture" runat="server" Height="80" ImageUrl='<%# Eval("UserPitcure") %>' AlternateText='<%# Eval("UserName") %>'  onerror="this.src='Images/menupicture.gif';" />
                                <br />
                                <asp:HyperLink ID="UserLink" runat="server" Text='<%# Eval("UserName") %>' NavigateUrl='<%# "~/UserPage.aspx?Id=" + Eval("UserId") %>' CssClass="reg_text red_inline_text" ></asp:HyperLink>
                            </td>
                            </tr>
                            </table>
                        </ItemTemplate>
                        </asp:Formview>
                    </div>
                </div>
                </asp:Panel>
                
                        
                <asp:Panel runat="server" ID="UsersCountPanel">
                
                <div id="userscount">
                    &nbsp;&nbsp; &nbsp;&nbsp; 
                    <g:plusone href="http://www.nivdal.com"></g:plusone>
                    &nbsp;&nbsp;    
                    <asp:Image ID="ActiveUsersImage" runat="server" ImageUrl="~/Images/Icons/active users.png"
                        ToolTip="Active Users" />
                    <asp:Label ID="NumberOfActiveUsersTitleLabel" runat="server" Text="<%$ Resources:Resource, NumberOfActiveUsersTitleText %>"
                        CssClass="reg_text red_inline_text" ></asp:Label>
                    <asp:Label ID="NumberOfActiveUsersLabel" runat="server" CssClass="reg_text red_inline_text"></asp:Label>
                    &nbsp;&nbsp;
                    <asp:Image ID="OnlineUsersImage" runat="server" ImageUrl="~/Images/Icons/online_users.png"
                        ToolTip="Online users" />
                    <asp:Label ID="NumberOfOnlineUsersLabelTitleLabel" runat="server" Text="<%$ Resources:Resource, NumberOfOnlineUsersTitleText %>"
                        CssClass="reg_text red_inline_text"></asp:Label>
                    <asp:Label ID="NumberOfOnlineUsersLabel" runat="server" Text="" CssClass="reg_text red_inline_text"></asp:Label>
                </div>
                
                </asp:Panel>
                </div>
            
            </asp:Panel>
            
            
            </div>
        </div>
        </div>
        </div>
        <div class="clearBoth"></div>
         </div>
        
        <div class="clearBoth"></div>
                    
                    
                    <%--<asp:HyperLink ID="AdvertiseHyperlink" runat="server" Font-Size="10px" Font-Names="Arial"
                        Font-Bold="True" ForeColor="#658321" Text="<%$ Resources:Resource, Global_Advertise %>"
                        NavigateUrl="~/Advertise.aspx"></asp:HyperLink>--%>

                    <%--<asp:Label ID="TryItNowLabel" runat="server" Text="<%$ Resources:Resource, Defult_FooterText %>"
                    Font-Size="8px" Font-Names="Arial" Font-Bold="True" ForeColor="#658321" ></asp:Label>
                    <br /><br />--%>

                    
                
    <%--</asp:Panel>--%>
    </div>
    </div>  
    </div>
    <div class="clearBoth"></div>
     
    <div class="footer">
    <div class="auto_margin site_width">
        <div class="tbl"><div class="tblr"><div class="tblc footercell">
        <asp:HyperLink ID="PrivacyPolicyHyperLink" runat="server" Text="<%$ Resources:Resource, Global_PrivacyPolicy %>"
            NavigateUrl="~/Privacy.aspx" Target="_blank"></asp:HyperLink>
        &nbsp;&nbsp;
        <asp:HyperLink ID="TermsHyperLink" runat="server" Text="<%$ Resources:Resource, Global_TermOfUse %>"
            NavigateUrl="~/Terms.aspx" Target="_blank"></asp:HyperLink>
        &nbsp;&nbsp;
        <asp:HyperLink ID="ContactHyperlink" runat="server" Text="<%$ Resources:Resource, Global_Contact %>"
            NavigateUrl="~/Contact.aspx"></asp:HyperLink>
        &nbsp;&nbsp;
        <%--<asp:HyperLink ID="AdvertiseHyperlink" runat="server"  NavigateUrl="~/Sponsors/Default.aspx"
                Text="<%$ Resources:Resource, BigMasterPage_AdvertiseHyperlink %>" ></asp:HyperLink>
        &nbsp;&nbsp;--%>
        <asp:HyperLink ID="EnterAsGuestLink" runat="server" NavigateUrl="~/Countries.aspx"
            Text="<%$ Resources:Resource, Default_EnterAsGuest %>"></asp:HyperLink>   
        <br />
        <asp:Label ID="Label2" runat="server" Text="<%$ Resources:Resource, BigMasterPage_copyrightLabel%>"></asp:Label>
        </div></div></div>
    </div>
    </div>
    
    <asp:SqlDataSource ID="WorldCountryStatisticsSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="Nivdal_GetWorldCountryStatistics" SelectCommandType="StoredProcedure">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="TeamOfTheDayDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="Nivdal_GetRandomTeam" SelectCommandType="StoredProcedure">
    </asp:SqlDataSource>

    </ContentTemplate>
    </asp:UpdatePanel>
    
    </form>

    <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>

   <%-- <script type="text/javascript" language="javascript">
        if (document.cookie == "") {
            alert(document.getElementById("CookiesWarningStringHiddenField").value);
        }    
    </script>--%>

    <script type="text/javascript">

        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-7321654-12']);
        _gaq.push(['_trackPageview']);

        (function() {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();

    </script>

</body>
</html>
